# _*_ coding: utf-8 _*_
__author__ = 'yinlei'
__date__ = '2018-05-28 20:10'

from .views import front_route
import config
from flask import session,g,render_template
from .models import FrontUser

@front_route.before_request
def front_before_request():
    if config.FRONT_USER_ID in session:
        user_id=session.get(config.FRONT_USER_ID)
        user=FrontUser.query.get(user_id)
        if user:
            g.front_user = user


@front_route.errorhandler(404)
def not_found_page(error):
    return render_template('front/front_404.html'),404